package com.biz.primus.ms.commodity.dao.po;


import com.biz.primus.base.vo.GeoLevel;
import com.biz.primus.ms.base.jpa.po.BaseEntityPKIncrement;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 销售区域和 Geo 关系Po
 *
 * @author david-liu
 * @date 2016年12月16日
 * @reviewer
 * @see
 */
@Entity
@Table(name = "pro_sale_area_geo")
public class SaleAreaGeo extends BaseEntityPKIncrement implements Serializable {

    private static final long serialVersionUID = -8049148688200666349L;

    /**
     * 销售区域
     */
    @ManyToOne
    @JoinColumn(name = "sale_area_id", nullable = false)
    private SaleArea saleArea;

    /**
     * 区域(省, 市, 销售区域 ID)
     */
    @Column(nullable = false)
    private Long geoId;

    /**
     * 地域等级(可能为省, 市, 销售区域)
     */
    @Column
    @Enumerated(EnumType.STRING)
    private GeoLevel geoLevel;

    public SaleArea getSaleArea() {
        return saleArea;
    }

    public void setSaleArea(SaleArea saleArea) {
        this.saleArea = saleArea;
    }

    public Long getGeoId() {
        return geoId;
    }

    public void setGeoId(Long geoId) {
        this.geoId = geoId;
    }

    public GeoLevel getGeoLevel() {
        return geoLevel;
    }

    public void setGeoLevel(GeoLevel geoLevel) {
        this.geoLevel = geoLevel;
    }
}
